/* File	    mac.h
 * Date	    2011-07-22
 * Author   Huawei.shen
 */

#ifndef __MAC_H__
#define __MAC_H__

#include "config.h"

#define MAC_MAX_IP      16
#define MAC_MAX_ADDR	20
#define MAC_MAX_NAME	32

typedef _MAC_ADDR {
    UINT32 maddr_len;	/* MAC address length*/
    UINT8  maddr[MAC_MAX_ADDR]; /* MAC address*/
}MAC_ADDR;

typedef _MAC {
    MAC_ADDR mac_a;	/* MAC original address*/
    MAC_ADDR mac_b;	/* MAC broad cast address*/
    UINT8    mac_type;	/* Dada-Link layer type*/
    UINT8    mac_wbit;	/* data bus width in bit*/
    UINT16   mac_mtu;	/* max transmit unit*/
    UINT16   mac_mode;	/* NIC working mode*/
    UINT16   mac_speed;	/* NIC link speed in kbps*/
    UINT16   mac_encrp;	/* MAC encription*/
    UINT32   mac_pro;	/* MAC propertys*/
    PVOID    mac_hbase; /* NIC hardware base address*/
    UINT8    mac_name[MAC_MAX_NAME];/* NIC name*/
    UINT16   mac_IP4_conf[MAX_IP4_CONF];/* IPv4 config items in IPv4 route table*/
    UINT16   mac_IP6_conf[MAX_IP6_CONF];/* IPv6 config items in IPv4 route table*/
    PVOID    mac_txque;	/* pointer to transmit queue*/
    PVOID    mac_rxque; /* pointer to resive queue*/

    INT32 (*mac_contrl_func)(INT32 ctrl, PVOID data, UINT32 data_len);
}MAC;

#define MAC_TYPE_NONE		0
#define MAC_TYPE_ETHER		3
#define MAC_TYPE_WIFI		11
#define MAC_TYPE_TRING		15

#define MAC_MODE_AUTO		0
#define MAC_MODE_10		1
#define MAC_MODE_100		2
#define MAC_MODE_1000		3
#define MAC_MODE_a		4
#define MAC_MODE_b		5
#define MAC_MODE_g		6
#define MAC_MODE_n		7

#define MAC_ENC_NONE		0
#define MAC_ENC_WEP		1
#define MAC_ENC_WPA		2
#define MAC_ENC_WPA2		3
#define MAC_ENC_PPP		4

#define MAC_LB_SUPPORT		1
#define MAC_FORB_BCAST		2
#define MAC_PHY_CRC		4
#define MAC_PHY_CRC_EN		8
#define MAC_IP4_CRC		16
#define MAC_IP4_CRC_EN		32
#define MAC_IP6_CRC		64
#define MAC_IP6_CRC_EN		128
#define MAC_SNIFER_MOD		256
#define MAC_DEVICE_EN		512
#define MAC_DEVICE_ERR		1024
#define MAC_LINK_ERR		2048
#define MAC_HW_ADDR_FILTER	4096
#define MAC_HW_ADDR_FILTER_EN	8192
#define MAC_HW_NEED_LEADING     16384

#endif /* end of __MAC_H__*/
